package com.xiangge.lianxi;

public class Demo2 {
    public static void main(String[] args) {
        String s = "";
        String s1 = "";
        /*for (int i = 1; i <= 100; i++) {
            if (i % 2 != 0) {
                s = s + i + " ";
            } else {
                s1 = s1 + i + " ";
            }
        }*/
        int i = 1;
        while (i <= 100) {
            if (i % 2 != 0) {
                s = s + i + " ";
            } else {
                s1 = s1 + i + " ";
            }
            i++;
        }

        System.out.println("奇数："+s);
        System.out.println("偶数："+s1);
    }
}
